import { http } from "@/utils/http"
import type { BannerType, CategoryType, HotType, LikeType } from '@/types/home'
import type { PageResult, PageParams} from '@/types/global'

/**
 * 展示位置 distributionSite
 * 首页 1
 * 分类商品页 2
 */
export const getHomeSwiper = (distributionSite = 1) =>{
  return http<BannerType[]>(({
    method:'GET',
    url:'/home/banner',
    data:{
      distributionSite
    }
  }))
}
export const getCategory = () =>{
  return http<CategoryType[]>(({
    method:'GET',
    url:'/home/category/mutli'
  }))
}
export const getHotPanel = () =>{
  return http<HotType[]>(({
    method:'GET',
    url:'/home/hot/mutli'
  }))
}

export const getHomeLike = (data?: PageParams) => {
  return http<PageResult<LikeType>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}